//
//  OCCaculatorFactory.m
//  CaculatorTest
//
//  Created by rain on 2018/4/23.
//  Copyright © 2018年 rain. All rights reserved.
//

#import "OCCaculatorFactory.h"
#import "OCOperatServiceManager.h"

@implementation OCCaculatorFactory
+ (instancetype)shareInstance
{
    static dispatch_once_t p;
    static id instance = nil;
    
    dispatch_once(&p, ^{
        instance = [[self alloc] init];
    });
    
    return instance;
}

- (id)createService:(Protocol *)proto;
{
    return [[OCOperatServiceManager sharedManager] createOperService:proto];
}

- (void)registerService:(Protocol *)proto service:(Class) serviceClass
{
    [[OCOperatServiceManager sharedManager] registerOperService:proto impClass:serviceClass];
}
@end
